const star = [
	{label:'一星',value:'1',type:'primary'},
	{label:'二星',value:'2',type:'primary'},
	{label:'三星',value:'3',type:'primary'},
	{label:'四星',value:'4',type:'primary'},
	{label:'五星',value:'5',type:'primary'},
]

const anonymity = [
    {label:'不匿名',value:'1',type:'success'},
    {label:'匿名',value:'0',type:'danger'},
]
const tableConfig = {
	stripe: true,
	border: true,
	maxHeight: '80vh',
	columns: [
		{
			label: '订单号',
			prop: 'orderId',
		},
		{
			label: '评价星级',
			prop: 'serviceStar',
			custome:"tag",
			dicData:star
		},
		{
			label: '是否匿名',
			prop: 'anonymityFlag',
			custome:"tag",
			dicData:anonymity
		},
		{
			label: '评价人',
			prop: 'createUserName',
		},
		
		{
			label: '备注',
			prop: 'remark',
		},
		{
			label: '评价时间',
			prop: 'createTime',
		},
		{
			label: '上链状态',
			prop: 'onBlockchainFlag',
			api: 'geiDictItemList',
			type: 'select',
			custome:'tag',
			code: 'BLOCK_CHAIN_STATUS',
			defaultValue:'1'
		},
		
	],
}
const searchConfig = {
	inline: true,
	showBtn: true,
	labelPosition: 'left',
	column: [
		{
			label: '评价星级',
			prop: 'serviceStar',
			type:"sselect",
			dicData:star,
			span:8
		},
		{
			label: '是否匿名',
			prop: 'anonymityFlag',
			type:"sselect",
			dicData:anonymity,
			span:8
		},
		{
			label: '评价人',
			prop: 'createUserName',
			span:8
		},
		{
			label: '评价时间',
			prop: 'createTimeBetween',
			type:'datetimerange',
			format:"YYYY年MM月DD HH:mm:ss",
			valueFormat:'YYYY-MM-DD HH:mm:ss',
			span:16
		},
	],
}
export const baseConfig: any = {
	pageName: '用户评价记录',
	addLabel: '添加',
	rowKey: 'id',
	dictcodes:['BLOCK_CHAIN_STATUS'],
	tipLabel: 'orderId',
	api: {
		index: 'view_bscOrderComment_page',
	},
	auth: {
		index: 'view_bscOrderComment_page',
	},
	paramsObj:{
	},
	dialogConfig: {
		width: '65%',
	},
	searchConfig,
	tableConfig,
	beforeOnLoadFormate: async (params) => {
		if (params.createTimeBetween) {
			params.createTimeBetween = params.createTimeBetween.join(',')
		}
		return Promise.resolve({
			...params,
		})
	},
}
